#include <stdio.h>

int calculation(int size)
{
    int num = 1;
    for (int i = 1; i <= size; i++)
    {
        num *= i;
    }
    return num;
}

int compute(int size)
{
    int snum = 0;
    for (int i = 1; i <= size; i++)
    {
        snum += calculation(i);
    }
    return snum;
}

int main()
{
    int size = 0;
    scanf("%d", &size);
    if (size == 0)
    {
        printf("不能为0,请重新输入");
        return 0;
    }

    int sum = compute(size);

    printf("%d\n", sum);

    return 0;
}